import json

import pytest
from api.urls import SubmitAPI

@pytest.fixture(scope="session")
def api_client():
    """全局 API 客户端，base_url 可按需配置"""
    return SubmitAPI(base_url="http://172.22.6.110:8848")

@pytest.fixture
def auth_headers():
    """假设需要认证的 Header（根据实际接口修改）"""
    headers = {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer TGT-1114-UD7pRdJuTjaTktnFW5MKZi1VxIygy7Udw7tWXE5NXqHC-LcsWeOwQu6fwZebaSrFaT0t-d-sso-srv02'
    }
    return headers

@pytest.fixture
def initiative_payload():
    """url1 的默认测试数据，可参数化覆盖"""
    with open('resources/payload_L.json', 'rb') as f:
        payload = json.load(f)
        f.close()
    payload_submit = json.dumps(payload)
    return payload_submit